package com.sxj.springsourcecode.springframework.factory.support;

import com.sxj.springsourcecode.springframework.factory.config.SingletonBeanRegestry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @ProjectName: spring-source-code
 * @Package: com.sxj.springsourcecode.springframework.factory.support
 * @ClassName: DefaultSingletonBeanRegestry
 * @Author: sxj
 * @Description:
 * @Date: 2024/2/21 11:44
 * @Version: 1.0.0
 */
public class DefaultSingletonBeanRegestry implements SingletonBeanRegestry {
    private Map<String,Object> singletonMap = new ConcurrentHashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return singletonMap.get(beanName);
    }

    @Override
    public void addSingleton(String beanName, Object bean) {
        singletonMap.put(beanName,bean);
    }




}
